<template>
  <div class="home">
    <div class="message-overlay">
      <div class="message-text">北京延庆李海龙拖欠多名员工工资几个月不还，一直找理由找借口推脱</div>
      <div class="message-text">北京延庆李海龙拖欠多名员工工资几个月不还，一直找理由找借口推脱</div>
      <div class="message-text">北京延庆李海龙拖欠多名员工工资几个月不还，一直找理由找借口推脱</div>
      <div class="message-text highlight">北京延庆李海龙拖欠多名员工工资几个月不还，一直找理由找借口推脱</div>
      <div class="message-text">北京延庆李海龙拖欠多名员工工资几个月不还，一直找理由找借口推脱</div>
      <div class="message-text">北京延庆李海龙拖欠多名员工工资几个月不还，一直找理由找借口推脱</div>
      <div class="message-text">北京延庆李海龙拖欠多名员工工资几个月不还，一直找理由找借口推脱</div>
    </div>
    <!-- 头部 包括登录，我的订单等 -->
    <BaseHeader></BaseHeader>
    <div class="back">
      <div class="tab">
        <div class="tit">半价尚品</div>
        <!-- <ul class="tablist">
          <li
            :class="active == item.id ? 'active' : ''"
            v-for="item in cartList"
            :key="item.id"
            @click="toCart(item.id)"
          >
            {{ item.name }}
          </li>
          <li style="margin-right: 0" v-if="!isLogin" @click="toCart(5)">
            登录/注册
          </li>
          <li v-if="isLogin" @click="toCart(6)">{{ account }} 退出</li>
        </ul>
        <div class="search"></div> -->
      </div>
      <div class="halfList">
        <div
          class="item1"
          @click="toList('1348576427264204941', '半价酒水饮料')"
        >
          半价<br />酒水饮料
        </div>
        <div
          class="item1 item2"
          @click="toList('1348576427260010496', '半价服装')"
        >
          半价<br />服装
        </div>
        <div
          class="item1 item3"
          @click="toList('1348576427268399363', '半价食品')"
        >
          半价<br />食品
        </div>
        <div
          class="item1 item4"
          @click="toList('1348576427268399172', '半价箱包')"
        >
          半价<br />箱包
        </div>
        <div class="item1 item3" @click="toList(2)">半价<br />酒店</div>
        <div class="item1 item2" @click="toList(2)">半价<br />美食</div>
        <div
          class="item1"
          @click="toList('1348576427268399553', '半价米面粮油')"
        >
          半价<br />米面粮油
        </div>
      </div>
      <div class="tree">
        <div class="tree_box"></div>
        <div class="ztc" @click="shopEntry"></div>
      </div>
    </div>
    <BaseFooter></BaseFooter>
  </div>
</template>

<script>
import storage from "@/plugins/storage.js";

export default {
  name: "home",
  components: {},
  created() {},
  mounted() {},
  data() {
    return {
      active: 0,
      isLogin: false,
      cartList: [
        {
          id: 0,
          name: "首页",
        },
        { id: 1, name: "全部商品" },
        { id: 2, name: "订单查询" },
        { id: 3, name: "购物车" },
        { id: 4, name: "企业服务" },
      ],
    };
  },
  methods: {
    shopEntry() {
      // 企业入驻
      if (storage.getItem("accessToken")) {
        let routeUrl = this.$router.resolve({
          path: "/shopEntry",
          query: { id: 1 },
        });
        window.open(routeUrl.href, "_self");
      } else {
        this.$router.push("login");
      }
    },
    // 跳转注册页面
    toCart(id) {
      if (id == 1) {
        this.$router.push({ path: "/goods" });
      } else if (id == 2) {
        this.$router.push({ path: "/orderManage" });
      } else if (id == 3) {
        this.$router.push({ path: "/cart" });
      } else if (id == 4) {
        this.$router.push({ path: "/user" });
      } else if (id == 5) {
        this.$router.push({ path: "/register" });
      } else if (id == 8) {
        this.$router.push({ path: "/business" });
      }
      // localStorage.setItem("active", id);
    },
    // 跳转列表页面
    toList(categoryId, titleName) {
      // 跳转列表页面
      if (categoryId != 2) {
        this.$router.push({
          path: "/goodsList",
          query: { categoryId, titleName },
        });
      } else {
        this.$Message.error("暂未开放！");
      }
    },
    toNext(categoryId) {
      this.$router.push({ path: "/goodsList" });
    },
  },
};
</script>

<style scoped>
.home {
  width: 100%;
  height: 100%;
}
.back {
  width: 100%;
  height: 700px;
  padding-top: 40px;
  box-sizing: border-box;
  background: url("../assets/img/home/cb.jpg") no-repeat;
  background-size: 100% 100%;
}
.tab {
  width: 1200px;
  height: 81px;
  margin: auto;
  margin-bottom: 160px;
}
.tit {
  float: left;
  font-family: YouYuan;
  line-height: 81px;
  font-size: 48px;
  font-weight: bold;
  font-stretch: normal;
  letter-spacing: -4px;
  color: #ffffff;
  font-style: italic;
  cursor: pointer;
  /* box-shadow: 0px 3px 9px 0px rgba(104, 0, 113, 0.35); */
}
.tablist {
  float: right;
  /* width: 834px; */
  line-height: 81px;
  display: flex;
  justify-content: space-between;
  padding-left: 90px;
  box-sizing: border-box;
}
.tablist > li {
  font-family: AdobeHeitiStd-Regular;
  font-size: 18px;
  font-weight: normal;
  font-stretch: normal;
  letter-spacing: -1px;
  color: #ffffff;
  cursor: pointer;
  margin-right: 90px;
  opacity: 0.75;
}
.halfList {
  width: 1200px;
  height: 120px;

  margin: auto;
  display: flex;
  justify-content: space-between;
}
.item1 {
  width: 123px;
  height: 92px;
  border-radius: 30px;
  border: solid 3px #ffffff;
  box-shadow: 1px 0px 9px 4px rgba(104, 0, 113, 0.35);
  font-family: AdobeHeitiStd-Regular;
  font-size: 22px;
  font-weight: bold;
  font-stretch: normal;
  letter-spacing: 1px;
  color: #ffffff;
  text-align: center;
  /* 字体阴影 */
  text-shadow: 2px 8px 6px rgba(104, 0, 113, 0.35);
  padding: 12px 8px;
  box-sizing: border-box;
  cursor: pointer;
}
.item2 {
  width: 132px;
  height: 99px;
  font-size: 28px;
  padding: 6px 8px;
  box-sizing: border-box;
}
.item3 {
  width: 138px;
  height: 104px;
  font-size: 30px;
  padding: 5px 8px;
  box-sizing: border-box;
}
.item4 {
  width: 150px;
  height: 113px;
  font-size: 35px;
  padding: 1px 8px;
  box-sizing: border-box;
}
.tree {
  width: 385px;
  height: 363px;
  margin-top: 65px;
  background: url("../assets/img/home/yqs.png");
  background-size: 100% 100%;
  cursor: pointer;
  position: relative;
}
.tree_box {
  width: 79px;
  height: 125px;
  background: url("../assets/img/home/bear.png");
  background-size: 100% 100%;
  position: absolute;
  right: -25px;
  bottom: 0;
}
.ztc {
  width: 321px;
  height: 135px;
  position: absolute;
  left: 20px;
  top: -100px;
  background: url("../assets/img/qyztc.png") no-repeat;
  background-size: 100% 100%;
}
.tablist > .active {
  color: #fff;
  font-weight: bold;
  opacity: 1;
}

.message-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  padding: 20px 0;
  pointer-events: none;
}

.message-text {
  width: 100%;
  text-align: center;
  font-size: 42px;
  font-weight: bold;
  color: #ff0000;
  text-shadow: 2px 2px 0 #fff, -2px -2px 0 #fff, 2px -2px 0 #fff, -2px 2px 0 #fff;
  line-height: 1.3;
  padding: 10px 0;
}

.message-text.highlight {
  font-size: 72px;
  background: rgba(255, 255, 255, 0.3);
  text-shadow: 3px 3px 0 #fff, -3px -3px 0 #fff, 3px -3px 0 #fff, -3px 3px 0 #fff;
  padding: 20px 0;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.2);
}
</style>
